package com.iot.device.service.impl;

import java.util.List;
import java.util.Map;

import com.iot.device.domain.GasEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.GasEventMapper;
import com.iot.device.service.IGasEventService;

/**
 * 燃气事件Service业务层处理
 * 
 * @author iot
 * @date 2023-04-14
 */
@Service
public class GasEventServiceImpl implements IGasEventService
{
    @Autowired
    private GasEventMapper gasEventMapper;

    /**
     * 查询燃气事件
     * 
     * @param id 燃气事件主键
     * @return 燃气事件
     */
    @Override
    public GasEvent selectGasEventById(Long id)
    {
        return gasEventMapper.selectGasEventById(id);
    }

    /**
     * 查询燃气事件列表
     * 
     * @param gasEvent 燃气事件
     * @return 燃气事件
     */
    @Override
    public List<GasEvent> selectGasEventList(GasEvent gasEvent)
    {
        return gasEventMapper.selectGasEventList(gasEvent);
    }

    /**
     * 新增燃气事件
     * 
     * @param gasEvent 燃气事件
     * @return 结果
     */
    @Override
    public int insertGasEvent(GasEvent gasEvent)
    {
        return gasEventMapper.insertGasEvent(gasEvent);
    }

    /**
     * 修改燃气事件
     * 
     * @param gasEvent 燃气事件
     * @return 结果
     */
    @Override
    public int updateGasEvent(GasEvent gasEvent)
    {
        return gasEventMapper.updateGasEvent(gasEvent);
    }

    /**
     * 批量删除燃气事件
     * 
     * @param ids 需要删除的燃气事件主键
     * @return 结果
     */
    @Override
    public int deleteGasEventByIds(Long[] ids)
    {
        return gasEventMapper.deleteGasEventByIds(ids);
    }

    /**
     * 删除燃气事件信息
     * 
     * @param id 燃气事件主键
     * @return 结果
     */
    @Override
    public int deleteGasEventById(Long id)
    {
        return gasEventMapper.deleteGasEventById(id);
    }

    @Override
    public int batchInsertAlertEvent(List<GasEvent> list) {
        return gasEventMapper.batchInsertAlertEvent(list);
    }

    @Override
    public List<Map<String, Long>> selectGasEventRankByClient(Long userId, Long limit) {
        return gasEventMapper.selectGasEventRankByClient(userId, limit);
    }

    @Override
    public List<GasEvent> selectRecentGasEventList(Long userId, Long limit) {
        return gasEventMapper.selectRecentGasEventList(userId, limit);
    }
}
